package com.xmcowell.sportpacemaster.utils;

import android.content.Context;

import com.liulishuo.filedownloader.FileDownloadListener;
import com.liulishuo.filedownloader.FileDownloader;

/**
 * Created by fanyingmao on 16/8/19.
 */
public class DownloadUtils {
    public static void init(Context mContext) {
        /**
         * 仅仅是缓存Application的Context，不耗时
         */
        FileDownloader.init(mContext);
    }

    public static void downFile(String url, String path, FileDownloadListener mFileDownloadListener) {
        MyLog.i("url = " + url + "\npath = " + path);
        FileDownloader.getImpl().create(url)
                .setPath(path)
                .setListener(mFileDownloadListener).start();
    }
}
